<?php
class ctl_gallery extends shopPage{
    var $_call = 'index';
    function ctl_gallery(){
        parent::shopPage();
    }

    function index($view,$cat_id=0) {
        $this->pagedata['view'] = $view;
        $this->pagedata['cat_id'] = $cat_id;

        $row = array(array('m_id'=>'1','m_name'=>'模块1','m_fid'=>0),
        				array('m_id'=>'2','m_name'=>'模块2','m_fid'=>0),
        				array('m_id'=>'3','m_name'=>'模块3','m_fid'=>0),
        				array('m_id'=>'4','m_name'=>'模块4','m_fid'=>1),
        				array('m_id'=>'5','m_name'=>'模块5','m_fid'=>1),
        				array('m_id'=>'6','m_name'=>'模块6','m_fid'=>2),
        				array('m_id'=>'7','m_name'=>'模块7','m_fid'=>2),
        				array('m_id'=>'8','m_name'=>'模块8','m_fid'=>3),
        				array('m_id'=>'9','m_name'=>'模块9','m_fid'=>3));

        foreach( $row as $key=>$var ){
			if( $var['m_link'] ) $var['url'] = strpos( $var['m_link'],'?' ) ? $var['m_link']."&m_id=".$var['m_id'] : $var['m_link']."?m_id=".$var['m_id'];
			if( $var['m_fid'] == '0' ){
				$html_arr[] = $var;
			}
			else{
				$html_item[$var['m_fid']][] = $var;
			}
			$php_self ==$var['m_link'] and $this->pagedata['sel'] = $var['m_fid']; 
		}
		$this->pagedata['html_arr'] = $html_arr; 
		$this->pagedata['html_item'] = $html_item; 
		$this->pagedata['username'] = 'admin';

        $this->output();
    }
}
?>
